import wx

class Item(object):
    """Item class
    
    Attributes:
        toolTip: A wx.ToolTip instance.
    """
    
    label = ''
    help = ''
    _toolTipText = ''
    
    def __init__(self, label, help='', toolTip=None):
        self.label = label
        self.help = help
        self._toolTipText = toolTip
    
    _toolTip = None
    
    @property
    def toolTip(self):
        if not self._toolTip:
            if self._toolTipText: self._toolTip = wx.ToolTip(self._toolTipText)
            elif self.help: self._toolTip = wx.ToolTip(self.help)
        return self._toolTip
    
    def __str__(self):
        return self.label
    
    def __repr__(self):
        return self.label
    